/****************************************************
    Author:            龙之介
    CreatTime:    2020/12/26 21:20:8
    Description:     Nothing
*****************************************************/

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using UnityEngine.UI;
using ZYKTool;
using System.Linq;



namespace LongZhiJie
{
    public class CameraManger : MonoBehaviour
    {

        public Vector3 start = new Vector3(0, 0, -67);
        public Vector3 end = new Vector3(0, 0, -67);
        private Transform _PlayerPos;
        private float floowSpeed = 0.2f;
        public void Init()
        {
            _PlayerPos = TapTapStaticValue.Player.transform;

        }
        void LateUpdate()
        {
            if (TapTapStaticValue.Player == null) return;

            end.x = _PlayerPos.position.x + 3f;
            //start.y = playerPos.position.x;
            start.x = transform.position.x;
            start.y = transform.position.y;
            end.y = (_PlayerPos.position.y);



            transform.position = Vector3.Lerp(start, end, floowSpeed);
            start.z = transform.position.z;
            start.y = transform.position.y;


        }
    }
}